home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 5 / BBS in a Box -Volume V (BBS in a Box) (April 1992).iso / Files / Prog / M / MacOberon.cpt / MacOberon122.sit / Test.Mod (.txt) < prev    next >
Encoding:
Oberon Text  |  1990-10-18  |  2.3 KB  |  48 lines  |  [.Ob./.Ob*]

  1. Syntax10.Scn.Fnt
  2. Syntax10b.Scn.Fnt
  3. Syntax10i.Scn.Fnt
  4. MODULE Test;    (* Simple Example *)
  5. IMPORT
  6.     Texts, Oberon;
  7.     W: Texts.Writer;
  8. PROCEDURE Do*;
  9. BEGIN
  10.     Texts.WriteString(W, "Hello x"); Texts.WriteLn(W);
  11.     Texts.Append(Oberon.Log, W.buf)
  12. END Do;
  13. BEGIN
  14.     Texts.OpenWriter(W)
  15. END Test.
  16. 1.    Move the cursor into this viewer and press the Enter key on the keypad.
  17.             This will cause the viewer to be marked (a star will appear).
  18. 2.    Execute the command Compiler.Compile * (press control key over it).
  19.             A star as a parameter always indicates the marked viewer.
  20. 3.    You may now invoke the new command Test.Do as often as you like.
  21.             Just move the mouse cursor over it and press control.
  22. 4.    Modify the program, for example by changing the text that is printed.
  23. 5.    Compile again by invoking Compiler.Compile * as usual.
  24. 6.    Execute Test.Do again: the changes you made in the program have no
  25.             effect (yet), because the old version of module Test is still loaded.
  26. 7.    You may (re-)load the latest version of a command by interclicking the
  27.             mouse button during invocation (pressing the control key).
  28. 8.    Error positions in the text may be located by selecting the error message
  29.             "pos ... err ..." in the System.Log and executing Edit.Locate .
  30.             Selecting the first character on the line is sufficient.   The whole line
  31.             may also be selected by double-clicking.
  32. Oberon Compiler Options
  33. The Oberon Compiler accepts the following options:
  34.     s    Enable generation of new Symbol File
  35.     x    Disable Index Checks
  36.     n    Disable NIL Checks
  37.     t    Disable Type Checks
  38.     r    Enable Range Checks
  39.     g    Suppress Garbage Collection after this Compilation
  40. Each file parameter may be followed by a slash ("/") and a list of options.
  41. If garbage collection is suppressed, compilation runs faster but might not
  42. be completed if too many files or too much memory are used.  When you are
  43. compiling long lists of files, simply start out with garbage collection disabled
  44. and enable it just before those files at which the compiler generates a trap.
  45. Examples:
  46.     Compiler.Compile */n
  47.     Compiler.Compile ddt.Mod/s Hennessy.Mod/sxnt ~
  48.